﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/web.master" CodeBehind="maintenance_visit_list_bulk_failed.aspx.cs"
    Inherits="Shuba.Web.bulk_upload.maintenance_visit_list_bulk_failed" %>

<%@ Register Assembly="Shuba.Framework" Namespace="Shuba.Framework" TagPrefix="cc" %>
<asp:Content ID="Header1" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">

    <script type="text/javascript">
		function PrintThis() {
			var txt = document.getElementById('<%= txtSearch.ClientID %>').value;
			var batch = document.getElementById('<%= lblBatchID.ClientID %>');
			var batchisi = batch.innerHTML;
			window.open("maintenance_visit_list_bulk_failed.aspx?txtSearch=" + txt + "~" + batchisi);
		}
		
		function CheckAll()
        {
            var checkVal;
            if(document.all("ButSelect").value == "Check All")
            {
                checkVal = true;
                document.all("ButSelect").value = "Un-Check All";
            }else
            {
                checkVal = false;
                document.all("ButSelect").value = "Check All";
            }
            
            for (var n = 0; n < document.forms[0].length; n++) 
            {
                elm = document.forms[0].elements[n];
                if (elm.type == 'checkbox') 
                {
                    elm.checked = checkVal;
                }
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="text" border="0" width="100%" cellspacing="0" cellpadding="2">
        <tr>
            <td class="text bg_content" bgcolor="#FFFFFF" align="center">
                <p>
                    &nbsp;</p>
                <table class="black" border="0" width="95%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="title_back" align="left">
                            <table class="text" border="0" width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td class="title_back2" width="2%">
                                        &nbsp;
                                    </td>
                                    <td class="title_back2 title_white" width="38%">
                                        <asp:Label ID="LabelTitle" runat="server" Text="Label"></asp:Label>
                                    </td>
                                    <td>
                                        <span class="title_right"></span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td class="title_back" align="right">
                            <a class="text" href="maintenance_visit_monitoring.aspx">Maintenance Visit Monitoring List</a>&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="border_left bg_subtitle_white">
                            &nbsp;&nbsp;&nbsp;BATCH ID :
                            <asp:Label ID="lblBatchID" runat="server"></asp:Label>
                        </td>
                        <td class="border_right bg_subtitle" align="right">
                            CIF / Debtor Name&nbsp;<asp:TextBox ID="txtSearch" CssClass="text" runat="server"></asp:TextBox>&nbsp;
                            <asp:Button ID="btnSearch" CssClass="buttonsmall" runat="server" Text="Search" OnClick="btnSearch_Click" />&nbsp;&nbsp;
                            <input type="button" value="Export to Excel" onclick="PrintThis();" class="button" />&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <table class="border" width="100%">
                                <tr>
                                    <td class="text">
                                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                            <ContentTemplate>
                                                <cc:SHUBAGrid ID="gvList" runat="server" AutoGenerateColumns="False" Width="100%"
                                                    DataKeyNames="RECORD_ID" AllowPaging="True" PageSize="20" OnPageIndexChanging="gvList_PageIndexChanging"
                                                    OnRowDataBound="gvList_RowDataBound" OnRowCommand="gvList_RowCommand" AllowSorting="True"
                                                    OnSorting="gvList_Sorting">
                                                    <Columns>
                                                        <asp:BoundField DataField="CIF" HeaderText="CIF" SortExpression="CIF"
                                                            ItemStyle-HorizontalAlign="Center" />
                                                        <asp:BoundField DataField="UNIT_CODE" HeaderText="UNIT CODE" SortExpression="UNIT_CODE"
                                                            ItemStyle-HorizontalAlign="Center" />
                                                        <asp:BoundField DataField="DEBTOR_NAME" HeaderText="DEBTOR NAME" SortExpression="DEBTOR_NAME"
                                                            ItemStyle-HorizontalAlign="Left" />
                                                        <asp:BoundField DataField="ERR_LINE" HeaderText="ERROR LINE" SortExpression="ERR_LINE"
                                                            ItemStyle-HorizontalAlign="Center" />
                                                        <asp:BoundField DataField="ERR_DESC" HeaderText="ERROR DESCRIPTION" SortExpression="ERR_DESC"
                                                            ItemStyle-HorizontalAlign="Left" />
                                                        <%--<asp:TemplateField HeaderStyle-Width="10%">
                                                                <ItemTemplate>
                                                                    [&nbsp;&nbsp;<asp:LinkButton ID="btnDelete" CssClass="line" runat="server" CommandName="Remove" CommandArgument='<%#Eval("CIF") + "~" + Eval("LOAN_NUMBER")%>' OnClientClick="return confirm('Are you sure, you want to delete this record')">DELETE</asp:LinkButton>&nbsp;&nbsp;]
                                                                </ItemTemplate>
                                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                            </asp:TemplateField>  --%>
                                                    </Columns>
                                                    <PagerSettings Mode="Numeric" Visible="true" />
                                                    <EmptyDataTemplate>
                                                        <table class="text" width="100%" cellpadding="0" cellspacing="0">
                                                            <tr>
                                                                <td class="bg_grid2" align="center">
                                                                    NO RECORD FOUND
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </EmptyDataTemplate>
                                                </cc:SHUBAGrid>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="gvList" EventName="PageIndexChanging" />
                                                <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                                                <asp:AsyncPostBackTrigger ControlID="ddlMaintenanceVisitPage" />
                                            </Triggers>
                                        </asp:UpdatePanel>
                                    </td>
                                </tr>
                                <tr>
                                   <td>
                                        <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                                            <ContentTemplate>
                                                <div id="footLink" class="bg_footer text" runat="server">
                                                    <table width="100%">
                                                        <tr>
                                                            <td class="text">
                                                                <asp:ImageButton ID="firstLink" runat="server" CssClass="icon_first" OnClick="linkDataPage_Click"
                                                                    ImageUrl="~/images/trans.gif" />
                                                                <asp:ImageButton ID="prevLink" runat="server" CssClass="icon_previous" OnClick="linkDataPage_Click"
                                                                    ImageUrl="~/images/trans.gif" />
                                                                <asp:DropDownList ID="ddlMaintenanceVisitPage" runat="server" CssClass="text" OnSelectedIndexChanged="ddlMaintenanceVisitPage_IndexChange"
                                                                    AutoPostBack="true">
                                                                </asp:DropDownList>
                                                                <asp:ImageButton ID="nextLink" runat="server" CssClass="icon_next" OnClick="linkDataPage_Click"
                                                                    ImageUrl="~/images/trans.gif" />
                                                                <asp:ImageButton ID="lastLink" runat="server" CssClass="icon_last" OnClick="linkDataPage_Click"
                                                                    ImageUrl="~/images/trans.gif" />
                                                            </td>
                                                            <td style="text-align: right">
                                                                <asp:Label ID="lblPage" runat="server" Text="Page" CssClass="text"></asp:Label>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="gvList" EventName="PageIndexChanging" />
                                                <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                                                <asp:AsyncPostBackTrigger ControlID="ddlMaintenanceVisitPage" EventName="SelectedIndexChanged"/>
                                            </Triggers>
                                        </asp:UpdatePanel>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
